<template>
  <div id="app">
    <div id="bookContainer">
    <div>
      <div class="green"></div>
      <div class="wz">{{title}}</div>
      <div style="float:left;margin-top:8px;margin-right:5px;font-size:14px;margin-left:210px" id="refreshButton">换一批</div>
      <van-icon name="replay" style="float:left;margin-top:10px;margin-right:5px;" />
    </div>
    <div class="slider-container">
      <div class="slider">
        <div class="item-wrapper">
          <div class="item" v-for="item in items" :key="item.id">
            <div class="item-image">
              <img :src="item.src" />
            </div>
            <div class="item-details">
              <div>{{ item.name }}</div>
              <div>{{ item.master }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>

export default {
  props: ["items",'title'],
};


</script>

<style scope>
.slider-container {
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.slider-container::-webkit-scrollbar{
  width: 0; /* 隐藏滚动条宽度 */
  height: 0; /* 隐藏滚动条高度 */
  background: transparent; /* 隐藏滚动条背景 */
}

img{
  width:200px;
 
}
.slider {
  display: inline-block;
}

.item-wrapper {
  display: flex;
}

.item {
  flex: 0 0 auto;
  width: 150px; /* 调整项目的宽度 */
  height:191px;
  margin-right: 10px; /* 调整项目之间的间距 */
  background-color: #f2f2f2;
  border-radius: 5px;
  padding: 10px;
  box-sizing: border-box;
  font-size: 14px;
  margin-top: 2px;
}
.item-wrapper{
  margin-top: 2px;
}
.item:last-child {
  margin-right: 0;
}
.item-image{
  height:128px;
}
.item-image img {
    width: 125px;
    height: 134px;
    border-radius: 5px;
}

.item-details {
  margin-top: 8px;
}
.green {
  width: 3px;
  height: 16px;
  background-color: #2bb283;
  float: left;
  margin-top: 12px;
  margin-left: 8px;
  margin-right: 5px;
}
.wz {
  float: left;
  height: 16px;
  margin-top: 8px;
  margin-left: 5px;
  margin-right: 5px;
  font-size:16px;
}

.slider-container{
     margin-top: 50px;
    clear: both;
  width: 100%;
  overflow-x: auto;
  
}

</style>
